package com.lineage.config;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;
import org.apache.commons.logging.Log;

public final class Configtype {
  public static int weaponbroadfail;
  
  public static int armorbroadfail;
  
  public static int weaponbroadtrue;
  
  public static int armorbroadtrue;
  
  public static int Accessoryfalse;
  
  public static int Accessorytrue;
  
  public static int weapon_savebroad = 0;
  
  public static int armor_savebroad = 0;
  
  public static int Accessory_savebroad = 0;
  
  public static String msg1_fail;
  
  public static String msg1_true;
  
  public static String msg4_fail;
  
  public static String msg4_true;
  
  public static int armorlv;
  
  public static int weaponlv;
  
  private static Log _log;
  
  private static final String OTHER_SETTINGS_FILE = "./config/其他控制端/武卷防卷设定表.properties";
  
  public static void load() throws ConfigErrorException {
    Properties set = new Properties();
    try {
      InputStream is = new FileInputStream(new File("./config/其他控制端/武卷防卷设定表.properties"));
      InputStreamReader isr = new InputStreamReader(is, "utf-8");
      set.load(isr);
      is.close();
      Accessoryfalse = Integer.parseInt(set.getProperty("Accessoryfalse", "0"));
      Accessorytrue = Integer.parseInt(set.getProperty("Accessorytrue", "0"));
      weaponbroadfail = Integer.parseInt(set.getProperty("weaponbroadfail", "0"));
      armorbroadfail = Integer.parseInt(set.getProperty("armorbroadfail", "0"));
      weaponbroadtrue = Integer.parseInt(set.getProperty("weaponbroadtrue", "0"));
      armorbroadtrue = Integer.parseInt(set.getProperty("armorbroadtrue", "0"));
      weapon_savebroad = Integer.parseInt(set.getProperty("weapon_savebroad", ""));
      armor_savebroad = Integer.parseInt(set.getProperty("armor_savebroad", ""));
      Accessory_savebroad = Integer.parseInt(set.getProperty("Accessory_savebroad", ""));
      msg1_fail = set.getProperty("msg1_fail", "");
      msg1_true = set.getProperty("msg1_true", "");
      msg4_fail = set.getProperty("msg4_fail", "");
      msg4_true = set.getProperty("msg4_true", "");
      armorlv = Integer.parseInt(set.getProperty("armorlv", "20"));
      weaponlv = Integer.parseInt(set.getProperty("weaponlv", "20"));
    } catch (Exception e) {
      throw new ConfigErrorException("设置档案遗失: ./config/其他控制端/武卷防卷设定表.properties");
    } finally {
      set.clear();
    } 
  }
}
